package com.bytenebula.asteroid.entity.dto;

import com.bytenebula.asteroid.entity.BnUser;
import com.bytenebula.asteroid.entity.MetaDatabase;
import com.mybatisflex.annotation.RelationOneToOne;
import com.mybatisflex.annotation.Table;
import lombok.*;

import java.io.Serial;

/**
 *  实体类。
 *
 * @author patrick
 * @since 2024-09-15
 */
@Data
//@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("meta_database")
public class MetaDatabaseDTO extends MetaDatabase {

    @RelationOneToOne(selfField = "ownerId", targetTable = "bn_user", targetField = "id")
    private BnUser owner;

    /**
     * 创建用户信息
     */
    @RelationOneToOne(selfField = "createUserId", targetTable = "bn_user", targetField = "id")
    private BnUser createUser;

    /**
     * 最后修改用户信息
     */
    @RelationOneToOne(selfField = "lastModifiedUserId", targetTable = "bn_user", targetField = "id")
    private BnUser lastModifiedUser;
}
